<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
	<title>选择符|</title>
	<style type="text/css">
	* {
		padding: 0;
		margin: 0;
	}
	span.red{
		color: red;
	}
    </style>
</head>
<body>
	<div class="container" id="container">
		<h1>选择符|</h1>
		<div id="content">houdunren.com</div>
		<div>www.houdunren.com</div>
		<h1>houdunren.com</h1>
 		<h1>hdcms.com</h1>
	</div>
	<script type="text/javascript">
		// 匹配北京/上海的座机号，
		var reg = /010|020-\d{7,8}/		// error
		// 需要放在原子组中使用包起来	
		var reg = /(010|020)-\d{7,8}/	// ok
		var str = '010'
		console.log(str.match(reg))
		
	</script>
</body>
</html>